Text translation method and apparatus, electronic device, and storage medium

ABSTRACT

A text translation method is described that includes initially acquiring text. Thereafter, first text is determined in the initial text; and second text is determined according to the first text, where the second text is used for describing the first text. Additionally, initial text is translated to obtain initial translation text, and the second text is translated to obtain description translation text. Thereafter, the initial translation text is updated according to the description translation text to obtain target translation text of the initial text.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims priority to Chinese Patent Application No.CN202210446882.9, filed on Apr. 26, 2022, the disclosure of which isincorporated herein by reference in its entirety.

TECHNICAL FIELD

The present disclosure relates to the field of text processing and, inparticular, to the fields of intelligent search, artificialintelligence, and deep learning. For example, the present disclosurerelates to a text translation method and apparatus, an electronicdevice, and a storage medium.

BACKGROUND

With the development of the Internet, people are no longer satisfiedwith acquiring information from materials in a single language and beginto pay more attention to information acquisition from materials in otherlanguages. Therefore, it is necessary to implement cross-languageinformation acquisition with the help of an automatic machinetranslation system.

Language evolves over time. The accuracy of machine translationdetermines whether people can acquire information accurately.

SUMMARY

The present disclosure provides a text translation method and apparatus,an electronic device, and a storage medium.

According to an aspect of the present disclosure, a text translationmethod is provided. The method includes the steps below.

Initial text is acquired, and first text is determined in the initialtext.

Second text is determined according to the first text. The second textis used for describing the first text.

The initial text is translated to obtain initial translation text, andthe second text is translated to obtain description translation text.

The initial translation text is updated according to the descriptiontranslation text to obtain target translation text of the initial text.

According to an aspect of the present disclosure, a text translationapparatus is provided. The apparatus includes an initial textacquisition module, a description text acquisition module, a texttranslation module, and a translation text updating module.

The initial text acquisition module is configured to acquire initialtext and determine first text in the initial text.

The description text acquisition module is configured to determinesecond text according to the first text. The second text is used fordescribing the first text.

The text translation module is configured to translate the initial textto obtain initial translation text and translate the second text toobtain description translation text.

The translation text updating module is configured to update the initialtranslation text according to the description translation text to obtaintarget translation text of the initial text.

According to another aspect of the present disclosure, an electronicdevice is provided. The electronic device includes at least oneprocessor and a memory communicatively connected to the at least oneprocessor.

The memory stores an instruction executable by the at least oneprocessor. The instruction is executed by the at least one processor tocause the at least one processor to perform the text translation methodaccording to any embodiment of the present disclosure.

According to another aspect of the present disclosure, a non-transitorycomputer-readable storage medium is provided. The storage medium storesa computer instruction for causing a computer to perform the texttranslation method according to any embodiment of the presentdisclosure.

According to another aspect of the present disclosure, a computerprogram product is provided. The computer program product includes acomputer program. When the computer program is executed by a processor,the text translation method according to any embodiment of the presentdisclosure is performed.

Embodiments of the present disclosure can improve the accuracy of texttranslation.

It is to be understood that the content described in this part isneither intended to identify key or important features of embodiments ofthe present disclosure nor intended to limit the scope of the presentdisclosure. Other features of the present disclosure are apparent fromthe description provided hereinafter.

BRIEF DESCRIPTION OF DRAWINGS

The drawings are intended to provide a better understanding of thesolutions and not to limit the present disclosure. In the drawings:

FIG. 1 is a flowchart of a text translation method according to anembodiment of the present disclosure;

FIG. 2 is a flowchart of another text translation method according to anembodiment of the present disclosure;

FIG. 3 is a flowchart of another text translation method according to anembodiment of the present disclosure;

FIG. 4 is a scenario diagram of a text translation method according toan embodiment of the present disclosure;

FIG. 5 is a scenario diagram of a text translation method according toan embodiment of the present disclosure;

FIG. 6 is a structural diagram of a text translation apparatus accordingto an embodiment of the present disclosure; and

FIG. 7 is a block diagram of an electronic device for performing a texttranslation method according to an embodiment of the present disclosure.

DETAILED DESCRIPTION

Example embodiments of the present disclosure, including details ofembodiments of the present disclosure, are described hereinafter inconjunction with drawings to facilitate understanding. The exampleembodiments are illustrative only. Therefore, it is to be appreciated bythose of ordinary skill in the art that various changes andmodifications may be made to the embodiments described herein withoutdeparting from the scope and spirit of the present disclosure.Similarly, description of well-known functions and constructions isomitted hereinafter for clarity and conciseness.

FIG. 1 is a flowchart of a text translation method according to anembodiment of the present disclosure. This embodiment is applicable tothe case of text translation. The method of this embodiment can beperformed by a text translation apparatus. The apparatus may beimplemented by software and/or hardware and is specifically configuredin an electronic device having a certain data computing capability. Theelectronic device may be a client device or a server device. The clientdevice is, for example, a mobile phone, a tablet computer, an in-vehicleterminal, or a desktop computer.

In S101, initial text is acquired, and first text is determined in theinitial text.

The initial text is to-be-translated text. The initial text may includeat least one of the following: text in a query statement document andthe like. Exemplarily, the initial text may be acquired through an inputof a user. For example, the initial text may be text directly input bythe user or may be text obtained by recognizing a voice input by theuser. Additionally, the initial text may also be extracted from apublished document. The initial text may generally include at least oneof the following: a character, a word, a statement, and the like. Theinitial text may include the first text. The first text may be the sameas the initial text and may also be part of the initial text. The firsttext may include at least one of the following: a character, a word, astatement, and the like. At least one piece of first text may beincluded. At least one piece of first text may be determined in theinitial text. The first text may refer to text whose meaning isdifficult to determine or text whose meaning is prone to an error.Exemplarily, the first text may refer to text having multiple meanings,for example, a polysemant. Alternatively, the first text may be texthaving a newly derived meaning, for example, a new word, an Internetslang, or a hot word.

In a specific example, the initial text is a statement. The first textis a word. The initial text is acquired, word segmentation is performedon the initial text, and at least one word is selected from the obtainedwords and determined as the first text. For a selection manner, alexicon including words whose meanings are difficult to determine may bepre-established, and a word that is among the obtained words and thesame as a word in the lexicon is determined as the first text.

In S102, second text is determined according to the first text. Thesecond text is used for describing the first text.

The second text is used for describing the first text. For example, thesecond text is used for defining a meaning of the first text so as todistinguish a correct meaning of the first text in the initial text froma wrong meaning of the first text in the initial text, thereby assistingin translating the first text and correcting a translation result of thefirst text in the translation of the initial text. The second textincludes description text of the first text. The description text isused for assisting in translating the first text. The description textmay refer to text describing the first text. The description text may bethe same as the second text or may be text formed by adding content onthe basis of the description text, where the added content may be thefirst text.

Exemplarily, the description text may have the same meaning as the firsttext. That is, the description text may be synonymous text of the firsttext. In another example, the description text is definitive text of thefirst text. The definitive text is used for defining the first text. Thedefinitive text may include, for example, a function, origin, field ordevelopment course of first text content. Exemplarily, the first text is“

”. The second text includes synonymous text “

” of “

”. The second text may be “

”. Alternatively, the second text includes definitive text “

” of “

”. The second text may be “

”.

The step in which the second text is determined according to the firsttext may be that a near-synonym of the first text, a synonym of thefirst text, and a similar word of the first text are queried anddetermined as the description text and that the second text isgenerated. Alternatively, this step may also be that paraphrase contentof the first text is queried, that text is extracted from the paraphrasecontent and determined as the description text, and that the second textis generated.

In S103, the initial text is translated to obtain initial translationtext, and the second text is translated to obtain descriptiontranslation text.

The initial translation text is text obtained by translating the initialtext and is generally text obtained through machine translation. Thedescription translation text is text obtained by translating the secondtext and is generally text obtained through machine translation. Atranslation method may include, for example, a rule-based translationmethod, a corpus-based translation method, or a hybrid translationmethod. Exemplarily, text may be translated using a pre-trained neuralnetwork model, for example, a transformer model. The initial textincludes the first text. The initial translation text includes thetranslation of the first text. The initial text and the second text maybe translated synchronously or asynchronously.

In S104, the initial translation text is updated according to thedescription translation text to obtain target translation text of theinitial text.

The description translation text is used for updating the initialtranslation text and, specifically, for updating the translation of thefirst text so as to correct the wrong translation of the first text. Itis to be noted that an update may be a replacement or a rewrite. Thereplacement may be that word segmentation is performed on the initialtranslation text by using a rule-based replacement manner to obtain thetranslation of the first text and that the initial translation text isreplaced with the description translation text. The rewrite may beimplemented by using a pre-trained machine learning model. For example,the description translation text and the initial translation text areinput into a model to obtain the target translation text output by therewriting model. Exemplarily, the model may be a transformer model. Theinitial translation text is updated to obtain the target translationtext. The target translation text serves as the most accuratetranslation text of the initial text. After the target translation textis obtained, the target translation text may be provided for the user,or back translation and the like may also be performed.

In the related art, when some words, such as new words, hot words, andsome language and culture derivatives, are translated literally, theobtained results are different from actual meanings of the words,leading to translation errors. In the related art, such words need to bepre-collected manually, translated manually, and added to the corpus soas to be translated accurately.

According to technical solutions of the present disclosure, the firsttext in the initial text is acquired, and the second text generated bythe description text corresponding to the first text is acquired. Theinitial text and the second text are translated separately. The initialtranslation text obtained by translating the initial text is updatedbased on the description translation text obtained by translating thesecond text to obtain the target translation text of the initial text.With this arrangement, the translation of the first text in the initialtranslation text can be updated based on the description content of thefirst text and the correspondingly-obtained description translation textso that the translation of the first text is determined accurately inthe initial translation text, improving the accuracy of the translationof the first text, thereby improving the translation accuracy of thetarget translation text, reducing the cost of manual translation, andimproving the timeliness and efficiency of translation.

FIG. 2 is a flowchart of another text translation method according to anembodiment of the present disclosure. This embodiment is an optimizationand expansion of the preceding technical solutions and can be combinedwith each preceding optional embodiment. The step in which the initialtext is translated to obtain the initial translation text and the secondtext is translated to obtain the description translation text isspecifically that the initial text is spliced with the second text toobtain spliced text and that the spliced text is translated to obtainspliced translation text. The spliced translation text includes theinitial translation text and the description translation text.

In S201, initial text is acquired, and first text is determined in theinitial text.

In S202, second text is determined according to the first text. Thesecond text is used for describing the first text.

In S203, the initial text is spliced with the second text to obtainspliced text.

The spliced text includes the initial text and the second text. Thespliced text is used for translating the initial text and the secondtext simultaneously. A splicing manner may be that the initial text andthe second text are placed in the same statement or the same paragraphand are separated by a symbol separating pieces of text. The symbol isused for separating the initial text and the second text before andafter translation, guaranteeing that when the initial text and thesecond text are translated, the meaning of the initial text and themeaning of the second text do not interfere with each other.Exemplarily, the symbol may be, for example, a comma or a full stop. Forexample, the second text is placed behind the initial text and isseparated from the initial text by a comma. In a specific example, theinitial text is “

,

”. The first text is “

”. The second text is “

”. The spliced text is “

,

,

”.

In S204, the spliced text is translated to obtain spliced translationtext. The spliced translation text includes initial translation text anddescription translation text.

The spliced text is translated so that the initial text and the secondtext are translated simultaneously. The spliced translation text is thetranslation of the spliced text. The spliced translation text includesthe initial translation text obtained by translating the initial textand the description translation text obtained by translating the secondtext.

In fact, the meaning of the initial text and the meaning of the secondtext are not mixed in the spliced text. Therefore, when the spliced textis translated, the initial text and the second text are translatedindependently to form the spliced translation text. The splicedtranslation text includes the initial translation text and thedescription translation text. The initial translation text is thetranslation of the initial text. The description translation text is thetranslation of the second text. In the spliced translation text, asplicing structure of the initial translation text and the descriptiontranslation text may be the same as that of a splicing result of theinitial text and the second text. For example, the initial text and thesecond text are placed in the same statement and separated by a comma,the initial translation text and the description translation text areplaced in the same statement and separated by a comma, and the sequenceof the initial translation text and the description translation text inthe same statement is the same as the sequence of the initial text andthe second text in the same statement.

In S205, the initial translation text is updated according to thedescription translation text to obtain target translation text of theinitial text.

The step in which the initial translation text is updated according tothe description translation text is actually that the initialtranslation text included in the spliced translation text is updatedaccording to the description translation text included in the splicedtranslation text so as to obtain the target translation text of theinitial text. With this arrangement, the processing of two pieces oftext is converted into the synchronous processing of one piece of text,simplifying the translation operation and improving translationefficiency. Moreover, compared with the case where the second text andthe initial text are translated separately, and an associationrelationship between two translations needs to be established manuallyor through an additional operation, increasing translation complexity,the synchronous translation of the spliced text can reduce translationcomplexity and improve translation efficiency.

Optionally, the step in which the initial translation text is updatedaccording to the description translation text to obtain the targettranslation text of the initial text includes that the initialtranslation text in the spliced translation text is rewritten accordingto the description translation text included in the spliced translationtext to obtain the target translation text of the initial text.

The step in which the initial translation text in the splicedtranslation text is rewritten according to the description translationtext included in the spliced translation text may be understood asrewriting the spliced translation text to obtain the target translationtext or rewriting the initial translation text according to thedescription translation text. As for rewriting the initial translationtext according to the description translation text, the descriptiontranslation text needs to be eliminated additionally so that therewritten initial translation text is obtained and determined as thetarget translation text. The step in which the initial translation textin the spliced translation text is rewritten according to thedescription translation text included in the spliced translation text isactually that the translation of the first text in the initialtranslation text is corrected according to the description translationtext. However, a case exists where the first text and the second textare not synonyms, and in this case, a replacement cannot be performeddirectly because a direct replacement may lead to a grammatical error inthe corrected initial translation text. Therefore, the initialtranslation text is rewritten to obtain the corrected translation of thefirst text. Moreover, a statement conforming to the grammatical norms isdetermined as a target translation statement.

In a specific example, the initial text is “

”, and the second text is “

”. Correspondingly, the initial translation text is that “Rice circleculture has poisoned the younger generation”, and the descriptiontranslation text is that “Rice circle is short for fan group”. Since thefirst text is “

”. A result obtained through a direct replacement is text “Is short forfan group culture has poisoned the younger generation”. The grammar ofthe text does not conform to English norms, making the text not suitablefor serving as the translation. Accordingly, the initial translationtext can be rewritten according to the description translation text. Forexample, text “The fan culture has poisoned the younger generation” isobtained through rewriting, the grammar of the text conforms to Englishnorms, and moreover, the meaning of the translation is consistent withthe meaning of the initial text.

It is to be noted that the initial text may include at least one pieceof first text. Each piece of first text determines a corresponding pieceof second text. Therefore, at least one piece of second text exists. Thespliced text includes one piece of initial text and at least one pieceof second text. In the spliced text, the initial text is placed in thefirst place, the second text is placed behind the initial text forsplicing, and a comma is used for connecting two pieces of text in thesplicing. Exemplarily, the initial text is A. The second text includesB, C, and D. The spliced text is “A, B, C, D”. Correspondingly, eachpart in the spliced text is translated correspondingly to obtain thespliced translation text. In the spliced translation text, the initialtranslation text is placed in the first place, and the descriptiontranslation text is placed behind the initial translation text. A commais used for connecting the initial translation text and each piece ofdescription translation text. Moreover, the sequence of each piece ofsecond text is consistent with the sequence of each piece of descriptiontranslation text. In another example, the initial translation text isA′. The description translation text of second text B is B′. Thedescription translation text of second text C is C′. The descriptiontranslation text of second text D is D′. The spliced translation text is“A′, B′, C′, D′”.

Additionally, the step in which the initial translation text in thespliced translation text is rewritten according to the descriptiontranslation text in the spliced translation text can convert theprocessing of two pieces of text into the synchronous processing of onepiece of text, simplifying the rewrite operation and reducing the manualintervention of establishing the relationship between the descriptiontranslation text and the initial translation text in the rewriteprocess.

The step in which the initial translation text in the splicedtranslation text is rewritten through the description translation textin the same spliced translation text can simplify the rewrite operation,reduce the manual intervention of establishing the relationship betweenthe description translation text and the initial translation text in therewrite process, and improve translation and rewrite efficiency.Moreover, the rewriting of the initial translation text can reducegrammatical errors in the translation and improve translation accuracy.

Correspondingly, the step in which the initial translation text isupdated according to the description translation text to obtain thetarget translation text of the initial text may include that the initialtranslation text and the description translation text are determinedaccording to an arrangement sequence between the initial translationtext and the description translation text in the spliced translationtext and that the initial translation text is updated according to thedescription translation text.

Optionally, the step in which the initial translation text in thespliced translation text is rewritten according to the descriptiontranslation text included in the spliced translation text to determinethe target translation text of the initial text includes that thespliced translation text is input into a pre-trained rewriting model toobtain the target translation text of the initial text output and fromthe rewriting model.

The rewriting model is used for rewriting the initial translation textin the spliced translation text according to the description translationtext in the spliced translation text. The rewriting model is apre-trained deep learning model. For example, the rewriting model may bea transformer model. A training sample may include two pieces of text inthe same language. One piece of text is the spliced translation text,and the other piece of text is the target translation text. The splicedtranslation text is a statement formed by splicing the initialtranslation text with at least one piece of description translationtext. The initial translation text and the description translation textare connected through a comma.

In this embodiment, the initial translation text in the splicedtranslation text is rewritten based on the pre-trained rewriting modelso as to finally obtain the target translation text, thereby improvingtranslation accuracy and efficiency.

It is to be noted that the preceding translation and rewrite can beimplemented through the pre-trained model. For ease of translation andrewrite, the first text in the initial text and the second text may bereplaced with a corresponding placeholder. Different pieces of firsttext are replaced with different placeholders, thereby furthersimplifying the input and output of the model and enabling the firsttext to be recognized more accurately. Exemplarily, the initial text is“

,

”. The first text includes “

”, “

”, and “

” which are replaced with placeholder A, placeholder B, and placeholderC respectively. The replaced initial text is “

A,

B

C

”.

According to technical solutions of the present disclosure, the initialtext is spliced with the second text to form the spliced text. Thespliced text is translated to obtain the spliced translation text sothat the initial text and the second text are translated synchronously.The update of the initial translation text is converted into theprocessing of the spliced translation text, thereby reducing the manualintervention of the initial text and the second text in the translationprocess. Moreover, the processing of two pieces of text is convertedinto the synchronous processing of one piece of text, simplifying thetranslation operation and improving translation efficiency.

FIG. 3 is a flowchart of another text translation method according to anembodiment of the present disclosure. This embodiment is an optimizationand expansion of the preceding technical solutions and can be combinedwith each preceding optional embodiment. The step in which the secondtext is determined according to the first text is specifically thatparaphrase content of the first text is acquired and that descriptiontext of the first text is determined according to the paraphrase contentand the second text is generated.

In S301, initial text is acquired, and first text is determined in theinitial text.

In S302, paraphrase content of the first text is acquired.

The paraphrase content of the first text may refer to encyclopedicknowledge associated with the first text. The paraphrase content of thefirst text is used for determining a meaning of the first text in theinitial text so as to distinguish the meaning of the first text in theinitial text from a meaning of the first text in another text anddistinguish the meaning of the first text in the initial text fromanother meaning of the first text. The paraphrase content of the firsttext may include multiple meanings of the first text, for example, anoriginal meaning and an extended meaning. The paraphrase content of thefirst text may also include, for example, an example statement in whicheach meaning is applied, an origin of each meaning, and an associatedknowledge document of each meaning. Additionally, involved subjectknowledge, critical information, and related policy information may alsobe included in the paraphrase content according to application fields ofdifferent meanings.

The paraphrase content of the first text may be acquired through a queryin the network. For example, content related to the first text issearched by calling a query interface of encyclopedia knowledge and isdetermined as the paraphrase content of the first text.

In S303, description text of the first text is determined according tothe paraphrase content, and the second text is generated.

The paraphrase content may include redundant and irrelevant informationand may be processed to obtain the description text. Exemplarily, anabstract is extracted from the paraphrase content to obtain thedescription text. The abstract may be extracted from the paraphrasecontent through a pre-trained machine learning model. The pre-trainedmachine learning model may include, for example, a sequence-to-sequencemodel or a long short-term memory neural network model. Alternatively,each statement in the paraphrase content may be matched with the firsttext to obtain a statement matching the first text, and the statement isdetermined as the description text. The statement matching the firsttext may be a statement including the first text. Additionally, thedescription text may be determined from the paraphrase content accordingto the initial text and the first text. Since the first text may be apolysemant, the meaning of the first text in the initial text may bedetermined according to the initial text so that the description text ofthe first text is determined more accurately.

The paraphrase content of the first text may be acquired through a queryin a question-answering system or through a query in a search engine.Exemplarily, a question of the first text, for example, “what does thefirst text mean”, may be generated and input into the question-answeringsystem. The question-answering system acquires the paraphrase content ofthe first text according to the question and extracts the abstract ofthe paraphrase content to obtain the description text of the first text.

The generation of the second text is actually that the second text isgenerated according to the description text of the first text. Forexample, the description text may be determined as the second textdirectly. Alternatively, the description text is processed to generatethe second text. The processing is specifically that a correspondencebetween the description text and the first text is established to formthe second text.

Optionally, the second text includes the correspondence between thefirst text and the description text.

The correspondence between the first text and the description text isused for determining that a relationship exists between the first textand the description text and indicating that the first text isconsistent with the description text. In fact, multiple pieces of firsttext may exist in the initial text. A piece of description text isdetermined corresponding to each piece of first text, and a piece ofsecond text is generated. Correspondingly, multiple pieces ofdescription text and multiple pieces of second text exist. Therefore, acorrespondence between a piece of first text and a piece of descriptiontext is established in a piece of second text so that it can bedetermined that the piece of second text is determined for which pieceof first text. Therefore, multiple pieces of second text may bedistinguished according to different pieces of first text. The secondtext includes the correspondence between the first text and thedescription text, which is actually equal to that the second textfurther includes the first text, the description text, and a conjunctiondescribing the correspondence. The conjunction may include, for example,“

” or “

”.

Additionally, the second text includes the first text so that the firsttext does not need to be identified additionally in the initial text.Therefore, only text repeated in the initial text and the second textneeds to be determined to serve as the first text, saving the cost ofmanual identification.

A specific manner of establishing the correspondence may be to establisha definitive relationship between the first text and the descriptiontext. For example, an equivalent relationship is established between thefirst text and the description text and is usually described by “

” (is). For example, the first text is the description text. In anotherexample, a functional relationship is established between the first textand the description text and is usually described by “

” (is used for). For example, the first text is used for implementingthe description text. Additionally, other manners of establishing arelationship exist and may be arranged according to specific first textcontent and description text content. Exemplarily, the first text is “

”. The description text is “

”. The correspondence between the first text and the description text isan equivalent relationship. The second text may be “

”. In another example, the first text is “

”. The description text is “

”. The correspondence between the first text and the description text isa function-definitive relationship. The second text may be “

”.

Correspondingly, the step in which the second text is generatedaccording to the description text of the first text may be specifiedbelow. In the case where the description text includes thecorrespondence between the first text and the description text, thedescription text is determined as the second text; alternatively, astatement template matching the correspondence is queried for inpre-established statement templates, and the first text and thedescription text are added to corresponding positions to form the secondtext. In the case where the description text includes no correspondencebetween the first text and the description text, the correspondencebetween the description text and the first text is established, and thefirst text and the description text are added to generate the secondtext. Exemplarily, the first text is “

”, the description text is “

”, neither the first text nor the correspondence between the first textand the description text exists in the description text, and thegenerated second text is “

” according to the first text, the description text, and thecorrespondence between the first text and the description text. Inanother example, the description text is “

”, the description text includes the first text and the correspondencebetween the first text and the description text, and the descriptiontext is determined as the second text which is specifically “

”.

Different pieces of first text may be distinguished and different piecesof second text may be determined correspondingly by defining thecorrespondence between the first text and the description text.Moreover, the second text includes the first text so as to identify thefirst text existing in the initial text, reducing the cost of manualidentification.

In S304, the initial text is translated to obtain initial translationtext, and the second text is translated to obtain descriptiontranslation text.

In S305, the initial translation text is updated according to thedescription translation text to obtain target translation text of theinitial text.

Optionally, a literal meaning of the first text is different from anactual meaning of the first text.

The literal meaning refers to a meaning determined according to ameaning of each character included in the first text. The actual meaningrefers to a correct meaning of the first text or the meaning of thefirst text in the initial text. The difference between the literalmeaning and the actual meaning indicates that the actual meaning of thefirst text cannot be determined directly according to the meaning ofeach character included in the first text. Exemplarily, a literalmeaning of “

” is a rice circle, while an actual meaning of “

” is a fan group. In another example, a literal meaning of “

” is to remove the grass, while an actual meaning of “

” is to remove the grass or to eliminate a desire. In another example, aliteral meaning of “

” is that wind comes when no cave exists, while an actual meaning of “

” is that wind only comes when a cave exists or that a rumor iswell-founded.

A user may pre-collect, for example, words appearing in the network andmay also collect a large number of words to automatically screen outhigh-frequency words to generate a lexicon. The lexicon is pre-collectedtext. The lexicon is used for determining the first text in the initialtext. The lexicon may be understood as a word library. The initial textis matched with the lexicon. Text that is in the lexicon and the same asthe initial text is determined as the first text.

The first text with its literal meaning different from its actualmeaning is determined in the initial text. With this arrangement, textwhose meaning is prone to a wrong detection and which is also easy totranslate wrongly is determined in the initial text. Moreover, atargeted correction is performed, optimizing targeted translation andimproving translation accuracy.

According to technical solutions of the present disclosure, theparaphrase content of the first text is acquired, the description textof the first text is determined, and the second text is generated basedon the description text. With this arrangement, the second textdescribes the first text accurately. Therefore, the meaning of the firsttext can be described accurately according to the second text. Theinitial translation text is updated based on the description translationtext of the second text to obtain the target translation text, improvingthe translation accuracy of the first text in the target translationtext and thereby improving the translation accuracy of the targettranslation text.

FIG. 4 is a scenario diagram of a text translation method according toan embodiment of the present disclosure. The text translation method mayinclude the steps below.

In S401, initial text is acquired, and first text is determined in theinitial text. A literal meaning of the first text is different from anactual meaning of the first text.

It is queried according to a pre-collected lexicon whether a word in theinitial text is the same as a word in the lexicon. The word isdetermined as the first text. At least one piece of first text may bedetermined in the initial text. For example, the initial text is “

”. The determined first text is “

”.

In S402, paraphrase content of the first text is acquired.

The paraphrase content of the first text may be queried through aquestion-answering system according to the first text. As in a previousexample, the paraphrase content is as follows: Fans is short for a fangroup in Internet slang; additionally, the English word of “

” is “fans”; and the word fans is composed of fan and s, where sgenerally indicates a plurality, and fan may be transliterated directlyinto “

”. A fan group is called “

”. The circle formed by the fan group is called “

” which has a synonym of “

”.

In S403, description text of the first text is determined according tothe paraphrase content, and second text is generated.

The paraphrase content is input into an abstract generation modelthrough the question-answering system so that abstract text, of theparaphrase content, output by the abstract generation model is obtainedand determined as the description text of the first text. In the casewhere the description text includes a correspondence between the firsttext and the description text, the description text is determined as thesecond text. In the case where the description text includes nocorrespondence between the first text and the description text, thecorrespondence between the first text and the description text isestablished, and the first text and the description text are added togenerate the second text.

As in the previous example, the description text is “

,

”. The generated second text is “

*”.

In S404, the initial text is spliced with the second text to obtainspliced text.

The initial text is placed in the first place. The second text may beplaced in sequence according to a sequence of each piece of first textin the initial text. The pieces of text are connected through a comma sothat a complete statement is formed and determined as the spliced text.

As in the previous example, the spliced text is “

,

”.

In S405, the spliced text is translated to obtain spliced translationtext. The spliced translation text includes initial translation text anddescription translation text.

The spliced text may be translated through a pre-trained translationmodel to obtain the spliced translation text. In fact, the spliced textmay be translated by using an existing translation model trained on alarge-scale data set with no need for retraining.

As in the previous example, the spliced translation text is that “Therice circle culture has poisoned the young generation, The rice circleis short for fan group”.

In S406, the initial translation text in the spliced translation text isrewritten according to the description translation text included in thespliced translation text to obtain target translation text of theinitial text.

The spliced translation text may be rewritten through a pre-trainedrewriting model. For example, the initial translation text is rewrittenaccording to the description translation text so that the rewritteninitial translation text is obtained and determined as the targettranslation text. The rewriting model may be trained with a small amountof monolingual training data, greatly reducing the difficulty oftraining the rewriting model.

As in the previous example, the target translation text is that “The fanculture has poisoned the young generation”.

In embodiments of the present disclosure, an entire process ofimplementing the text translation method may be defined as a process ofprocessing a translation and rewriting model. The translation andrewriting model may include a translation model and a rewriting model.When the translation and rewriting model is trained, the followingoperations are performed on training linguistic data (x, y) in which,for example, x is “

” and y is “The fan culture has poisoned the younger generation”: 1. Thefirst text is searched for and replaced (for example, “

” is replaced with placeholder X), and the second text is determined; 2.the replaced initial text and the second text are spliced; 3. thespliced translation text (“X culture has poisoned the youngergeneration. X is short for fan group.”) is generated by using thepre-trained translation model; 4. the spliced translation text and y aretaken as an input and an output respectively to serve as a trainingsample for training the translation and rewriting model. For example,for an application scenario of the text translation method, refer toFIG. 5 .

According to technical solutions of the present disclosure, knowledgequery and fusion are implemented, greatly improving the timeliness oftranslating new words and hot words and saving tremendous costs ofmanual intervention. Through a translation model and a rewrite model,knowledge fusion is implemented and a translation result are madestrongly explanatory and more accurate.

According to embodiments of the present disclosure, FIG. 6 is astructural diagram of a text translation apparatus according to anembodiment of the present disclosure. This embodiment of the presentdisclosure is applicable to the case of text translation. The apparatusis implemented by software and/or hardware and is specificallyconfigured in an electronic device having a certain data computingcapability.

The text translation apparatus 600 shown in FIG. 6 includes an initialtext acquisition module 601, a description text acquisition module 602,a text translation module 603, and a translation text updating module604.

The initial text acquisition module 601 is configured to acquire initialtext and determine first text in the initial text.

The description text acquisition module 602 is configured to determinesecond text according to the first text. The second text is used fordescribing the first text.

The text translation module 603 is configured to translate the initialtext to obtain initial translation text and translate the second text toobtain description translation text.

The translation text updating module 604 is configured to update theinitial translation text according to the description translation textto obtain target translation text of the initial text.

According to technical solutions of the present disclosure, the firsttext in the initial text is acquired, and the second text generated bythe description text corresponding to the first text is acquired. Theinitial text and the second text are translated separately. The initialtranslation text obtained by translating the initial text is updatedbased on the description translation text obtained by translating thesecond text to obtain the target translation text of the initial text.With this arrangement, the translation of the first text in the initialtranslation text can be updated based on the description content of thefirst text and the correspondingly-obtained description translation textso that the translation of the first text is determinedly accurately inthe initial translation text, improving the accuracy of the translationof the first text, thereby improving the translation accuracy of thetarget translation text, reducing the cost of manual translation, andimproving the timeliness and efficiency of translation.

Further, the text translation module 603 includes a text splicing unitand a spliced text translation unit. The text splicing unit isconfigured to splice the initial text with the second text to obtainspliced text. The spliced text translation unit is configured totranslate the spliced text to obtain spliced translation text. Thespliced translation text includes the initial translation text and thedescription translation text.

Further, the translation text updating module 604 includes a translationtext rewrite unit. The translation text rewrite unit is configured torewrite the initial translation text in the spliced translation textaccording to the description translation text included in the splicedtranslation text to obtain the target translation text of the initialtext.

Further, the translation text rewrite unit includes a model rewritingsub-unit configured to input the spliced translation text into apre-trained rewriting model to obtain the target translation text of theinitial text and output from the rewriting model.

Further, the description text acquisition module 602 includes aparaphrase content acquisition unit and a description text determinationunit. The paraphrase content acquisition unit is configured to acquireparaphrase content of the first text. The description text determinationunit is configured to determine description text of the first textaccording to the paraphrase content and generate the second text.

Further, the second text includes a correspondence between the firsttext and the description text.

Further, a literal meaning of the first text is different from an actualmeaning of the first text.

The preceding text translation apparatus may perform the texttranslation method according to any embodiment of the present disclosureand has function modules and beneficial effects corresponding to theexecution of the text translation method.

In technical solutions of the present disclosure, the collection,storage, use, processing, transmission, provision, and disclosure ofuser personal information involved are in compliance with provisions ofrelevant laws and regulations and do not violate public order and goodcustoms.

According to embodiments of the present disclosure, the presentdisclosure further provides an electronic device, a readable storagemedium, and a computer program product.

FIG. 7 is a block diagram of an example electronic device 700 forimplementing an embodiment of the present disclosure. The electronicdevice is intended to represent various forms of digital computers, forexample, a laptop computer, a desktop computer, a workbench, a personaldigital assistant, a server, a blade server, a mainframe computer, oranother applicable computer. The electronic device may also representvarious forms of mobile apparatuses, for example, a personal digitalassistant, a cellphone, a smartphone, a wearable device, or a similarcomputing apparatus. Herein the shown components, the connections andrelationships between these components, and the functions of thesecomponents are illustrative only and are not intended to limit theimplementation of the present disclosure as described and/or claimedherein.

As shown in FIG. 7 , the device 700 includes a computing unit 701. Thecomputing unit 701 may perform various types of appropriate operationsand processing based on a computer program stored in a read-only memory(ROM) 702 or a computer program loaded from a storage unit 708 to arandom-access memory (RAM) 703. Various programs and data required foroperations of the device 700 may also be stored in the RAM 703. Thecomputing unit 701, the ROM 702, and the RAM 703 are connected to eachother through a bus 704. An input/output (I/O) interface 705 is alsoconnected to the bus 704.

Multiple components in the device 700 are connected to the I/O interface705. The multiple components include an input unit 706 such as akeyboard and a mouse, an output unit 707 such as various types ofdisplays and speakers, the storage unit 708 such as a magnetic disk andan optical disk, and a communication unit 709 such as a network card, amodem and a wireless communication transceiver. The communication unit709 allows the device 700 to exchange information/data with otherdevices over a computer network such as the Internet and/or over varioustelecommunication networks.

The computing unit 701 may be a general-purpose and/or special-purposeprocessing component having processing and computing capabilities.Examples of the computing unit 701 include, but are not limited to, acentral processing unit (CPU), a graphics processing unit (GPU), aspecial-purpose artificial intelligence (AI) computing chip, a computingunit executing machine learning model algorithms, a digital signalprocessor (DSP), and any appropriate processor, controller andmicrocontroller. The computing unit 701 executes various methods andprocessing described above, such as the text translation method. Forexample, in some embodiments, the text translation method may beimplemented as a computer software program tangibly contained in amachine-readable medium such as the storage unit 708. In someembodiments, part or all of computer programs may be loaded and/orinstalled on the device 700 via the ROM 702 and/or the communicationunit 709. When the computer program is loaded to the RAM 703 andexecuted by the computing unit 701, one or more steps of the precedingtext translation method may be executed. Alternatively, in otherembodiments, the computing unit 701 may be configured, in any othersuitable manner (for example, by means of firmware), to perform the texttranslation method.

Herein various embodiments of the preceding systems and techniques maybe implemented in digital electronic circuitry, integrated circuitry,field-programmable gate arrays (FPGAs), application-specific integratedcircuits (ASICs), application-specific standard products (ASSPs),systems on chips (SoCs), complex programmable logic devices (CPLDs),computer hardware, firmware, software, and/or combinations thereof. Thevarious embodiments may include implementations in one or more computerprograms. The one or more computer programs are executable and/orinterpretable on a programmable system including at least oneprogrammable processor. The programmable processor may be a dedicated orgeneral-purpose programmable processor for receiving data andinstructions from a memory system, at least one input device and atleast one output device and transmitting the data and instructions tothe memory system, the at least one input device and the at least oneoutput device.

Program codes for implementation of the methods of the presentdisclosure may be written in one programming language or any combinationof multiple programming languages. The program codes may be provided forthe processor or controller of a general-purpose computer, aspecial-purpose computer, or another programmable data processingapparatus to enable functions/operations specified in flowcharts and/orregional diagrams to be implemented when the program codes are executedby the processor or controller. The program codes may be executedentirely on a machine, partly on a machine, as a stand-alone softwarepackage, partly on a machine and partly on a remote machine, or entirelyon a remote machine or a server.

In the context of the present disclosure, the machine-readable mediummay be a tangible medium that may include or store a program that isused by or in conjunction with a system, apparatus or device thatexecutes instructions. The machine-readable medium may be amachine-readable signal medium or a machine-readable storage medium. Themachine-readable medium may include, but is not limited to, anelectronic, magnetic, optical, electromagnetic, infrared, orsemiconductor system, apparatus or device or any appropriate combinationthereof. Concrete examples of the machine-readable storage medium mayinclude an electrical connection based on one or more wires, a portablecomputer disk, a hard disk, a random-access memory (RAM), a read-onlymemory (ROM), an erasable programmable read-only memory (EPROM) or aflash memory, an optical fiber, a portable compact disc read-only memory(CD-ROM), an optical storage device, a magnetic storage device, or anyappropriate combination thereof.

In order that interaction with a user is provided, the systems andtechniques described herein may be implemented on a computer. Thecomputer has a display device for displaying information to the user,such as a cathode-ray tube (CRT) or a liquid-crystal display (LCD)monitor, and a keyboard and a pointing device such as a mouse or atrackball through which the user can provide input for the computer.Other types of devices may also be used for providing interaction with auser. For example, feedback provided for the user may be sensoryfeedback in any form (for example, visual feedback, auditory feedback,or haptic feedback). Moreover, input from the user may be received inany form (including acoustic input, voice input, or haptic input).

The systems and techniques described herein may be implemented in acomputing system including a back-end component (for example, a dataserver), a computing system including a middleware component (forexample, an application server), a computing system including afront-end component (for example, a client computer having a graphicaluser interface or a web browser through which a user can interact withimplementations of the systems and techniques described herein) or acomputing system including any combination of such back-end, middlewareor front-end components. Components of a system may be interconnected byany form or medium of digital data communication (for example, acommunication network). Examples of the communication network include alocal area network (LAN), a wide area network (WAN), and the Internet.

The computing system may include clients and servers. The clients andthe servers are usually far away from each other and generally interactthrough the communication network. The relationship between the clientsand the servers arises by virtue of computer programs running onrespective computers and having a client-server relationship to eachother. A server may be a cloud server, a server of a distributed system,or a server combined with a blockchain.

It is to be understood that various forms of the preceding flows may beused, with steps reordered, added, or removed. For example, the stepsdescribed in the present disclosure may be executed in parallel, insequence, or in a different order as long as the desired results of thetechnical solutions disclosed in the present disclosure are achieved.The execution sequence of these steps is not limited herein.

The scope of the present disclosure is not limited to the precedingembodiments. It is to be understood by those skilled in the art thatvarious modifications, combinations, sub-combinations, and substitutionsmay be made depending on design requirements and other factors. Anymodifications, equivalent substitutions, improvements, and the like madewithin the spirit and principle of the present disclosure are within thescope of the present disclosure.

What is claimed is:
 1. A text translation method, comprising: acquiringinitial text and determining first text in the initial text; determiningsecond text according to the first text, wherein the second text is usedfor describing the first text; translating the initial text to obtaininitial translation text and translating the second text to obtaindescription translation text; and updating the initial translation textaccording to the description translation text to obtain targettranslation text of the initial text.
 2. The method according to claim1, wherein translating the initial text to obtain the initialtranslation text and translating the second text to obtain thedescription translation text comprises: splicing the initial text withthe second text to obtain spliced text; and translating the spliced textto obtain spliced translation text, wherein the spliced translation textcomprises the initial translation text and the description translationtext.
 3. The method according to claim 2, wherein updating the initialtranslation text according to the description translation text to obtainthe target translation text of the initial text comprises: rewriting theinitial translation text in the spliced translation text according tothe description translation text comprised in the spliced translationtext to obtain the target translation text of the initial text.
 4. Themethod according to claim 3, wherein rewriting the initial translationtext in the spliced translation text according to the descriptiontranslation text comprised in the spliced translation text to determinethe target translation text of the initial text comprises: inputting thespliced translation text into a pre-trained rewriting model to obtainthe target translation text of the initial text and output from therewriting model.
 5. The method according to claim 1, wherein determiningthe second text according to the first text comprises: acquiringparaphrase content of the first text; and determining description textof the first text according to the paraphrase content and generating thesecond text.
 6. The method according to claim 5, wherein the second textcomprises a correspondence between the first text and the descriptiontext.
 7. The method according to claim 1, wherein a literal meaning ofthe first text is different from an actual meaning of the first text. 8.A text translation apparatus, comprising: at least one processor; and amemory communicatively connected to the at least one processor, whereinthe memory stores an instruction executable by the at least oneprocessor, and the instruction is executed by the at least one processorto cause the at least one processor to perform steps in the followingmodules: an initial text acquisition module configured to acquireinitial text and determine first text in the initial text; a descriptiontext acquisition module configured to determine second text according tothe first text, wherein the second text is used for describing the firsttext; a text translation module configured to translate the initial textto obtain initial translation text and translate the second text toobtain description translation text; and a translation text updatingmodule configured to update the initial translation text according tothe description translation text to obtain target translation text ofthe initial text.
 9. The apparatus according to claim 8, wherein thetext translation module comprises: a text splicing unit configured tosplice the initial text with the second text to obtain spliced text; anda spliced text translation unit configured to translate the spliced textto obtain spliced translation text, wherein the spliced translation textcomprises the initial translation text and the description translationtext.
 10. The apparatus according to claim 9, wherein the translationtext updating module comprises: a translation text rewrite unitconfigured to rewrite the initial translation text in the splicedtranslation text according to the description translation text comprisedin the spliced translation text to obtain the target translation text ofthe initial text.
 11. The apparatus according to claim 10, wherein thetranslation text rewrite unit comprises: a model rewriting sub-unitconfigured to input the spliced translation text into a pre-trainedrewriting model to obtain the target translation text of the initialtext and output from the rewriting model.
 12. The apparatus according toclaim 8, wherein the description text acquisition module comprises: aparaphrase content acquisition unit configured to acquire paraphrasecontent of the first text; and a description text determination unitconfigured to determine description text of the first text according tothe paraphrase content and generate the second text.
 13. The apparatusaccording to claim 12, wherein the second text comprises acorrespondence between the first text and the description text.
 14. Theapparatus according to claim 8, wherein a literal meaning of the firsttext is different from an actual meaning of the first text.
 15. Anon-transitory computer-readable storage medium storing a computerinstruction for causing a computer to perform the following steps:acquiring initial text and determining first text in the initial text;determining second text according to the first text, wherein the secondtext is used for describing the first text; translating the initial textto obtain initial translation text and translating the second text toobtain description translation text; and updating the initialtranslation text according to the description translation text to obtaintarget translation text of the initial text.
 16. The medium according toclaim 15, wherein translating the initial text to obtain the initialtranslation text and translating the second text to obtain thedescription translation text comprises: splicing the initial text withthe second text to obtain spliced text; and translating the spliced textto obtain spliced translation text, wherein the spliced translation textcomprises the initial translation text and the description translationtext.
 17. The medium according to claim 16, wherein updating the initialtranslation text according to the description translation text to obtainthe target translation text of the initial text comprises: rewriting theinitial translation text in the spliced translation text according tothe description translation text comprised in the spliced translationtext to obtain the target translation text of the initial text.
 18. Themedium according to claim 17, wherein rewriting the initial translationtext in the spliced translation text according to the descriptiontranslation text comprised in the spliced translation text to determinethe target translation text of the initial text comprises: inputting thespliced translation text into a pre-trained rewriting model to obtainthe target translation text of the initial text and output from therewriting model.
 19. The medium according to claim 15, whereindetermining the second text according to the first text comprises:acquiring paraphrase content of the first text; and determiningdescription text of the first text according to the paraphrase contentand generating the second text.
 20. The medium according to claim 19,wherein the second text comprises a correspondence between the firsttext and the description text.